package com.molichuxing.services.infrastructure.dao;


import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.molichuxing.framework.dao.RootMapper;
import com.molichuxing.services.infrastructure.bean.CarsViolationBean;
import com.molichuxing.services.infrastructure.dto.response.CarViolationAppDto;
import com.molichuxing.services.infrastructure.dto.response.PieChartDto;
import com.molichuxing.services.infrastructure.dto.response.ViolationCountDto;

public interface CarsViolationMapper extends RootMapper<CarsViolationBean> {

    int getCarsViolationPageCount(@Param("params") Map<String, Object> map);

    List<CarsViolationBean> getCarsViolationPage(@Param("params") Map<String, Object> map,@Param("pageNum") Integer pageNum,@Param("pageSize") Integer pageSize);

    int getCarsViolationCount(@Param("params") Map<String, Object> map,@Param("value") Integer value);

    List<CarsViolationBean> getCarsViolationByCarId(Integer carId);

    List<CarsViolationBean> getCarsViolationByOrderCode(Long orderCode);

    List<CarsViolationBean> getCarsViolationByUserId(@Param("userId")Integer userId,@Param("carId")Integer carId);

    Integer getViolationCountByUserId(Integer userId);

    List<CarViolationAppDto> getCarViolationAppDtoByUserId(Integer userId);

    int updateById(CarsViolationBean carsViolationBean);

    CarsViolationBean getCarsViolationDto(@Param("userId") Integer userId,@Param("carId") Integer carId ,@Param("regulationTime") LocalDateTime regulationTime);

    int modifyViolationStatusByCarId(@Param("carId")Integer carId, @Param("status")Integer status);

    List<PieChartDto> getViolationFractionPie();

    ViolationCountDto getSumStatistics();

    List<PieChartDto> getViolationCountPieDto();

    Integer getViolationCount();

    /**
     * 违章待处理和待缴费记录的车辆id
     * @return
     */
    List<CarsViolationBean> getCarsViolationByStatus();

    /**
     * 违章待处理和待缴费记录的车辆id By vin
     * @return
     */
    List<CarsViolationBean> getCarsViolationByVin();

    List<PieChartDto> getViolationFineFeePie();
    
    /**
     * 查询导出违章数据
     * @param map
     * @return
     */
    List<CarsViolationBean> getCarsViolationDownload(@Param("params") Map<String, Object> map);

	/**
	 * 查询导出车辆违章数据条数
	 * 
	 * @param selectParams
	 * @return
	 */
	Long getCarsViolationDownloadCount(@Param("params") Map<String, Object> selectParams);

    /**
     * 查询违章数量
     *
     * @param carId
     * @return
     */
    Integer getViolationCountByCarId(@Param("carId")Integer carId);
    
    int modifyStatusAndOpTypeById(@Param("id")Integer id, @Param("status")Integer status, @Param("opType")Integer opType);

}